Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clarifications for documentation #28

Merged
merged 6 commits into from
Aug 17, 2023
Merged

Add clarifications for documentation #28

merged 6 commits into from
Aug 17, 2023

Conversation

kirillsemyonkin
Copy link
Collaborator

This PR modifies the text of lib.rs and trait ImplicitClone documentations, hopefully clarifying some points that caused #6.

Also while writing new documentation, I've noticed missing implementation for a Copy type &T. There was present implementation for &'static str, but it not only does not have to be 'static, it does not even have to be str - it can be T: ?Sized.

Added some tests for the lib.rs types, as means of more documentation and examples of using the crate.

I believe this will be my last PR before 0.4.1 or 0.5.0 (which one should be used? considering &'static str has become &T).

Copy link
Member

@cecton cecton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this will be my last PR before 0.4.1 or 0.5.0 (which one should be used? considering &'static str has become &T).

I think in 0.x.y crates, the x is kinda major and y is minor. &T being a superset of &'static str, I guess we could go with 0.4.1

Comment on lines +12 to +16
This library introduces the marker trait [`ImplicitClone`](https://docs.rs/implicit-clone/latest/implicit_clone/trait.ImplicitClone.html) intended for
cheap-to-clone types that should be allowed to be cloned implicitly. It enables host libraries
using this crate to have the syntax of [`Copy`][std::marker::Copy] while actually calling the
[`Clone`][std::clone::Clone] implementation instead (usually when host library does such syntax
in a macro).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like very much the new wording 👍 thanks!

README.md Outdated Show resolved Hide resolved
@@ -62,7 +73,7 @@ impl_implicit_clone!(
f32, f64,
bool,
usize, isize,
&'static str, char,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome

@kirillsemyonkin kirillsemyonkin merged commit 5f2072c into main Aug 17, 2023
13 checks passed
@kirillsemyonkin kirillsemyonkin deleted the clarify-doc branch August 17, 2023 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants